<?php

namespace app\index\controller;

use app\api\controller\Basic;

class Notify extends Basic
{
    public function checkOrder()
    {
        $where[] = ['order.isdel', '=', 0];
        $where[] = ['order.status', '=', 4];
        $where[] = ['order_timing.status', 'in', [0, 1, 3]];
        $where[] = ['order_timing.endtime', '>', time()];
        $data['where'] = $where;
        $data['join'] = [
            ['order order', 'order.orderid = evaluate.orderid', 'inner'],
        ];
        $data['field'] = "order_timing.*,order.coachid,order.memberid,order.amount,order.price";
        $data['limit'] = 3;
        $tableName = 'order_timing';
        $list = $this->listTable($tableName, $data);

        foreach ($list as $val) {
            if ($val['endtime'] > time()) {
            $this->resultsEndTo($val);
            }
        }

        return true;
    }

    
}
